package com.bbzn.device.client.controller;

import com.bbzn.device.client.aspect.OperationAnnotation;
import com.bbzn.device.client.dataobject.StaticResources;
import com.bbzn.device.client.service.StaticResourcesService;
import com.bbzn.device.client.utils.BaseApiService;
import com.bbzn.device.client.utils.BaseResponse;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 曾俞钧
 * @Date : 2021/3/29 11:29
 * @Version 1.0
 */
@RestController
@RequestMapping("/stcResources")
//@CrossOrigin
public class StaticResourcesController extends BaseApiService {

    @Autowired
    StaticResourcesService staticResourcesService;

    /**
     * app 首页轮播图
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/listPicture", method = RequestMethod.POST)
    @OperationAnnotation(content = "首页轮播图")
    public BaseResponse listPicture() throws Exception {
        StaticResources staticResources =new StaticResources();
        // 1 广告
        staticResources.setPictureType(1);
        //  0开启 1禁用
        staticResources.setPictureState(0);
        staticResourcesService.advertisementList(staticResources);
        return  setResultSuccess(staticResources);

    }

}
